home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source2.lha / source / amiga / Rexx.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  24.0 KB  |  577 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: Rexx.mod $
  4.   Description: Interface to ARexx
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 02:39:55 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1987,1988,1989,1990 William S. Hawes
  14.   (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  24. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  25. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  26.  
  27. MODULE [2] Rexx;
  28.  
  29. IMPORT SYS := SYSTEM, e := Exec, d := Dos, s := Sets;
  30.  
  31.  
  32. (*
  33. **      $VER: storage.h 1.4 (8.11.91)
  34. **
  35. **      Header file to define ARexx data structures.
  36. *)
  37.  
  38.  
  39. (* The NexxStr structure is used to maintain the internal strings in REXX.
  40.  * It includes the buffer area for the string and associated attributes.
  41.  * This is actually a variable-length structure; it is allocated for a
  42.  * specific length string, and the length is never modified thereafter
  43.  * (since it's used for recycling).
  44.  *)
  45.  
  46. TYPE
  47.  
  48.   NexxStrPtr * = POINTER TO NexxStr;
  49.   NexxStr * = RECORD
  50.     ivalue * : LONGINT;                (* integer value                 *)
  51.     length * : e.UWORD;                (* length in bytes (excl null)   *)
  52.     flags *  : s.SET8;                 (* attribute flags               *)
  53.     hash *   : SHORTINT;               (* hash code                     *)
  54.     buff *   : ARRAY 8 OF CHAR;        (* buffer area for strings       *)
  55.   END; (* NexxStr *)                   (* size: 16 bytes (minimum)      *)
  56.  
  57. CONST
  58.  
  59.   nxAddLen * = 9;                     (* offset plus null byte *)
  60.  
  61. (* String attribute flag bit definitions                                *)
  62.   keep     * = 0;                 (* permanent string?             *)
  63.   string   * = 1;                 (* string form valid?            *)
  64.   notNum   * = 2;                 (* non-numeric?                  *)
  65.   number   * = 3;                 (* a valid number?               *)
  66.   binary   * = 4;                 (* integer value saved?          *)
  67.   float    * = 5;                 (* floating point format?        *)
  68.   ext      * = 6;                 (* an external string?           *)
  69.   source   * = 7;                 (* part of the program source?   *)
  70.  
  71. (* Combinations of flags                                                *)
  72.   intNum   * = { number, binary, string };
  73.   dpNum    * = { number, float };
  74.   alpha    * = { notNum, string };
  75.   owned    * = { source, ext, keep };
  76.   keepStr  * = { string, source, notNum };
  77.   keepNum  * = { string, source, number, binary };
  78.  
  79. (* The RexxArg structure is identical to the NexxStr structure, but
  80.  * is allocated from system memory rather than from internal storage.
  81.  * This structure is used for passing arguments to external programs.
  82.  * It is usually passed as an "argstring", a pointer to the string buffer.
  83.  *)
  84.  
  85. TYPE
  86.  
  87.   RexxArgPtr * = POINTER TO RexxArg;
  88.   RexxArg * = RECORD
  89.     size *   : LONGINT;                (* total allocated length        *)
  90.     length * : e.UWORD;                (* length of string              *)
  91.     flags *  : s.SET8;                 (* attribute flags               *)
  92.     hash *   : SHORTINT;               (* hash code                     *)
  93.     buff *   : ARRAY 8 OF CHAR;        (* buffer area                   *)
  94.   END; (* RexxArg *)                   (* size: 16 bytes (minimum)      *)
  95.  
  96. (* The RexxMsg structure is used for all communications with REXX
  97.  * programs.  It is an EXEC message with a parameter block appended.
  98.  *)
  99.  
  100. TYPE
  101.  
  102.   RexxMsgBase *= RECORD (e.MessageBase) END;
  103.   RexxMsgBasePtr *= POINTER TO RexxMsgBase;
  104.  
  105.   RexxMsgPtr * = POINTER TO RexxMsg;
  106.   RexxMsg * = RECORD (RexxMsgBase)
  107.     node *      : e.Message;            (* EXEC message structure        *)
  108.     taskBlock   : e.APTR;               (* global structure (private)    *)
  109.     libBase     : e.LibraryPtr;         (* library base (private)        *)
  110.     action *    : LONGINT;              (* command (action) code         *)
  111.     result1 *   : e.APTR;               (* primary result (return code)  *)
  112.     result2 *   : e.APTR;               (* secondary result              *)
  113.     args *      : ARRAY 16 OF e.LSTRPTR; (* argument block (ARG0-ARG15)   *)
  114.     passPort *  : e.MsgPortPtr;         (* forwarding port               *)
  115.     commAddr *  : e.LSTRPTR;             (* host address (port name)      *)
  116.     fileExt *   : e.LSTRPTR;             (* file extension                *)
  117.     stdin *     : d.FileHandlePtr;      (* input stream (filehandle)     *)
  118.     stdout *    : d.FileHandlePtr;      (* output stream (filehandle)    *)
  119.     avail *     : LONGINT;              (* future expansion              *)
  120.   END; (* RexxMsg *)                   (* size: 128 bytes               *)
  121.  
  122. CONST
  123.  
  124.   maxRMArg  * = 15;                   (* maximum arguments             *)
  125.  
  126. (* Command (action) codes for message packets                           *)
  127.   rxComm    * = 01000000H;           (* a command-level invocation    *)
  128.   rxFunc    * = 02000000H;           (* a function call               *)
  129.   rxClose   * = 03000000H;           (* close the REXX server *)
  130.   rxQuery   * = 04000000H;           (* query for information *)
  131.   rxAddFH   * = 07000000H;           (* add a function host           *)
  132.   rxAddLib  * = 08000000H;           (* add a function library        *)
  133.   rxRemLib  * = 09000000H;           (* remove a function library     *)
  134.   rxAddCon  * = 0A000000H;           (* add/update a ClipList string  *)
  135.   rxRemCon  * = 0B000000H;           (* remove a ClipList string      *)
  136.   rxTCOpn   * = 0C000000H;           (* open the trace console        *)
  137.   rxTCCls   * = 0D000000H;           (* close the trace console       *)
  138.  
  139. (* Command modifier flag bits                                           *)
  140.   rxNoIO    * = 00010000H;        (* suppress I/O inheritance?     *)
  141.   rxResult  * = 00020000H;        (* result string expected?       *)
  142.   rxString  * = 00040000H;        (* program is a "string file"?   *)
  143.   rxToken   * = 00080000H;        (* tokenize the command line?    *)
  144.   rxNonRet  * = 00100000H;        (* a "no-return" message?        *)
  145.  
  146.   rxfNoIO    * = 16;                (* suppress I/O inheritance?     *)
  147.   rxfResult  * = 17;                (* result string expected?       *)
  148.   rxfString  * = 18;                (* program is a "string file"?   *)
  149.   rxfToken   * = 19;                (* tokenize the command line?    *)
  150.   rxfNonRet  * = 20;                (* a "no-return" message?        *)
  151.  
  152.   rxCodeMask   * = 0FF000000H;
  153.   rxArgMask    * = 0000000FH;
  154.  
  155. (* The RexxRsrc structure is used to manage global resources.  Each node
  156.  * has a name string created as a RexxArg structure, and the total size
  157.  * of the node is saved in the "rrSize" field.  The REXX systems library
  158.  * provides functions to allocate and release resource nodes.  If special
  159.  * deletion operations are required, an offset and base can be provided in
  160.  * "rrFunc" and "rrBase", respectively.  This "autodelete" function will
  161.  * be called with the base in register A6 and the node in A0.
  162.  *)
  163.  
  164. TYPE
  165.  
  166.   RexxRsrcBase *= RECORD (e.NodeBase) END;
  167.   RexxRsrcBasePtr *= POINTER TO RexxRsrcBase;
  168.  
  169.   RexxRsrcPtr * = POINTER TO RexxRsrc;
  170.   RexxRsrc * = RECORD (RexxRsrcBase)
  171.     node * : e.Node;
  172.     func * : INTEGER;                 (* "auto-delete" offset          *)
  173.     base * : e.APTR;                  (* "auto-delete" base            *)
  174.     size * : LONGINT;                 (* total size of node            *)
  175.     arg1 * : e.APTR;                  (* available ...         *)
  176.     arg2 * : e.APTR;                  (* available ...         *)
  177.   END; (* RexxRsrc *)                 (* size: 32 bytes                *)
  178.  
  179. CONST
  180.  
  181. (* Resource node types                                                  *)
  182.   any      * = 0;                 (* any node type ...             *)
  183.   lib      * = 1;                 (* a function library            *)
  184.   port     * = 2;                 (* a public port         *)
  185.   file     * = 3;                 (* a file IoBuff         *)
  186.   host     * = 4;                 (* a function host               *)
  187.   clip     * = 5;                 (* a Clip List node              *)
  188.  
  189. (* The RexxTask structure holds the fields used by REXX to communicate with
  190.  * external processes, including the client task.  It includes the global
  191.  * data structure (and the base environment).  The structure is passed to
  192.  * the newly-created task in its "wake-up" message.
  193.  *)
  194.  
  195. CONST
  196.  
  197.   globalSz  * = 200;                  (* total size of GlobalData      *)
  198.  
  199. TYPE
  200.  
  201.   RexxTaskPtr * = POINTER TO RexxTask;
  202.   RexxTask * = RECORD
  203.     global *   : ARRAY globalSz OF e.BYTE; (* global data structure *)
  204.     msgPort *  : e.MsgPort;            (* global message port           *)
  205.     flags *    : s.SET8;               (* task flag bits                *)
  206.     sigBit *   : SHORTINT;             (* signal bit                    *)
  207.  
  208.     clientID * : e.APTR;               (* the client's task ID          *)
  209.     msgPkt *   : e.APTR;               (* the packet being processed    *)
  210.     taskID *   : e.APTR;               (* our task ID                   *)
  211.     rexxPort * : e.APTR;               (* the REXX public port          *)
  212.  
  213.     errTrap *  : e.APTR;               (* Error trap address            *)
  214.     stackPtr * : e.APTR;               (* stack pointer for traps       *)
  215.  
  216.     header1 *  : e.List;               (* Environment list              *)
  217.     header2 *  : e.List;               (* Memory freelist               *)
  218.     header3 *  : e.List;               (* Memory allocation list        *)
  219.     header4 *  : e.List;               (* Files list                    *)
  220.     header5 *  : e.List;               (* Message Ports List            *)
  221.   END; (* RexxTask *)
  222.  
  223. CONST
  224.  
  225. (* Definitions for RexxTask flag bits                                   *)
  226.   trace   * = 0;                 (* external trace flag           *)
  227.   halt    * = 1;                 (* external halt flag            *)
  228.   susp    * = 2;                 (* suspend task?         *)
  229.   tCUse   * = 3;                 (* trace console in use? *)
  230.   wait    * = 6;                 (* waiting for reply?            *)
  231.   close   * = 7;                 (* task completed?               *)
  232.  
  233. (* Definitions for memory allocation constants                          *)
  234.   memQuant  * = 16;                  (* quantum of memory space       *)
  235.   memMask   * = 0FFFFFFF0H;           (* mask for rounding the size    *)
  236.  
  237.   memQuick  * = {0};           (* EXEC flags: public       *)
  238.   memClear  * = {16};          (* EXEC flags: memClear        *)
  239.  
  240. (* The SrcNode is a temporary structure used to hold values destined for
  241.  * a segment array.  It is also used to maintain the memory freelist.
  242.  *)
  243.  
  244. TYPE
  245.  
  246.   SrcNodePtr * = POINTER TO SrcNode;
  247.   SrcNode * = RECORD
  248.     succ * : SrcNodePtr;            (* next node                     *)
  249.     pred * : SrcNodePtr;            (* previous node                 *)
  250.     ptr *  : e.APTR;                (* pointer value                 *)
  251.     size * : LONGINT;               (* size of object                *)
  252.   END; (* SrcNode *)                (* size: 16 bytes                *)
  253.  
  254.  
  255. (*
  256. **      $VER: rexxio.h 1.4 (8.11.91)
  257. **
  258. **      Header file for ARexx Input/Output related structures
  259. *)
  260.  
  261.  
  262. CONST
  263.  
  264.   rxBuffSz  * = 204;                  (* buffer length         *)
  265.  
  266. (*
  267.  * The IoBuff is a resource node used to maintain the File List.  Nodes
  268.  * are allocated and linked into the list whenever a file is opened.
  269.  *)
  270.  
  271. TYPE
  272.  
  273.   IoBuffPtr * = POINTER TO IoBuff;
  274.   IoBuff * = RECORD (RexxRsrcBase)
  275.     node * : RexxRsrc;                   (* structure for files/strings   *)
  276.     rpt *  : e.APTR;                     (* read/write pointer            *)
  277.     rct *  : LONGINT;                    (* character count               *)
  278.     dFH *  : d.FileHandlePtr;            (* DOS filehandle                *)
  279.     lock * : d.FileLockPtr;              (* DOS lock                      *)
  280.     bct *  : LONGINT;                    (* buffer length                 *)
  281.     area * : ARRAY rxBuffSz OF SYS.BYTE; (* buffer area                   *)
  282.   END; (* IoBuff *)                      (* size: 256 bytes               *)
  283.  
  284. CONST
  285.  
  286. (* Access mode definitions                                              *)
  287.   ioExist   * = -1;                (* an external filehandle        *)
  288.   ioStrF    * = 0;                 (* a "string file"               *)
  289.   ioRead    * = 1;                 (* read-only access              *)
  290.   ioWrite   * = 2;                 (* write mode                    *)
  291.   ioAppend  * = 3;                 (* append mode (existing file)   *)
  292.  
  293. (*
  294.  * Offset anchors for SeekF()
  295.  *)
  296.   ioBegin   * = -1;               (* relative to start             *)
  297.   ioCurr    * = 0;        (* relative to current position  *)
  298.   ioEnd     * = 1;        (* relative to end               *)
  299.  
  300. (* The Library List contains just plain resource nodes.         *)
  301.  
  302. (*
  303.  * The RexxClipNode structure is used to maintain the Clip List.  The value
  304.  * string is stored as an argstring in the rrArg1 field.
  305.  *)
  306.  
  307. (*
  308.  * A message port structure, maintained as a resource node.  The ReplyList
  309.  * holds packets that have been received but haven't been replied.
  310.  *)
  311.  
  312. TYPE
  313.  
  314.   RexxMsgPortPtr * = POINTER TO RexxMsgPort;
  315.   RexxMsgPort * = RECORD (RexxRsrcBase)
  316.     node *      : RexxRsrc;           (* linkage node                  *)
  317.     port *      : e.MsgPort;          (* the message port              *)
  318.     replyList * : e.List;             (* messages awaiting reply       *)
  319.   END; (* RexxMsgPort *)
  320.  
  321. CONST
  322.  
  323. (*
  324.  * DOS Device types
  325.  *)
  326.  
  327.   dtDev    * = 0;                   (* a device                      *)
  328.   dtDir    * = 1;                   (* an ASSIGNed directory *)
  329.   dtVol    * = 2;                   (* a volume                      *)
  330.  
  331. (*
  332.  * Private DOS packet types
  333.  *)
  334.  
  335.   actionStack * = 2002;             (* stack a line                  *)
  336.   actionQueue * = 2003;             (* queue a line                  *)
  337.  
  338.  
  339. (*
  340. **      $VER: errors.h 1.4 (8.11.91)
  341. **
  342. **      Definitions for ARexx error codes
  343. *)
  344.  
  345. CONST
  346.  
  347.   errcMsg  * = 0;                 (*  error code offset           *)
  348.   err10001 * = errcMsg+1;         (*  program not found           *)
  349.   err10002 * = errcMsg+2;         (*  execution halted            *)
  350.   err10003 * = errcMsg+3;         (*  no memory available         *)
  351.   err10004 * = errcMsg+4;         (*  invalid character in program*)
  352.   err10005 * = errcMsg+5;         (*  unmatched quote             *)
  353.   err10006 * = errcMsg+6;         (*  unterminated comment        *)
  354.   err10007 * = errcMsg+7;         (*  clause too long             *)
  355.   err10008 * = errcMsg+8;         (*  unrecognized token          *)
  356.   err10009 * = errcMsg+9;         (*  symbol or string too long   *)
  357.  
  358.   err10010 * = errcMsg+10;        (*  invalid message packet      *)
  359.   err10011 * = errcMsg+11;        (*  command string error        *)
  360.   err10012 * = errcMsg+12;        (*  error return from function  *)
  361.   err10013 * = errcMsg+13;        (*  host environment not found  *)
  362.   err10014 * = errcMsg+14;        (*  required library not found  *)
  363.   err10015 * = errcMsg+15;        (*  function not found          *)
  364.   err10016 * = errcMsg+16;        (*  no return value             *)
  365.   err10017 * = errcMsg+17;        (*  wrong number of arguments   *)
  366.   err10018 * = errcMsg+18;        (*  invalid argument to function*)
  367.   err10019 * = errcMsg+19;        (*  invalid PROCEDURE           *)
  368.  
  369.   err10020 * = errcMsg+20;        (*  unexpected THEN/ELSE        *)
  370.   err10021 * = errcMsg+21;        (*  unexpected WHEN/OTHERWISE   *)
  371.   err10022 * = errcMsg+22;        (*  unexpected LEAVE or ITERATE *)
  372.   err10023 * = errcMsg+23;        (*  invalid statement in SELECT *)
  373.   err10024 * = errcMsg+24;        (*  missing THEN clauses        *)
  374.   err10025 * = errcMsg+25;        (*  missing OTHERWISE           *)
  375.   err10026 * = errcMsg+26;        (*  missing or unexpected END   *)
  376.   err10027 * = errcMsg+27;        (*  symbol mismatch on END      *)
  377.   err10028 * = errcMsg+28;        (*  invalid DO syntax           *)
  378.   err10029 * = errcMsg+29;        (*  incomplete DO/IF/SELECT     *)
  379.  
  380.   err10030 * = errcMsg+30;        (*  label not found             *)
  381.   err10031 * = errcMsg+31;        (*  symbol expected             *)
  382.   err10032 * = errcMsg+32;        (*  string or symbol expected   *)
  383.   err10033 * = errcMsg+33;        (*  invalid sub-keyword         *)
  384.   err10034 * = errcMsg+34;        (*  required keyword missing    *)
  385.   err10035 * = errcMsg+35;        (*  extraneous characters       *)
  386.   err10036 * = errcMsg+36;        (*  sub-keyword conflict        *)
  387.   err10037 * = errcMsg+37;        (*  invalid template            *)
  388.   err10038 * = errcMsg+38;        (*  invalid TRACE request       *)
  389.   err10039 * = errcMsg+39;        (*  uninitialized variable      *)
  390.  
  391.   err10040 * = errcMsg+40;        (*  invalid variable name       *)
  392.   err10041 * = errcMsg+41;        (*  invalid expression          *)
  393.   err10042 * = errcMsg+42;        (*  unbalanced parentheses      *)
  394.   err10043 * = errcMsg+43;        (*  nesting level exceeded      *)
  395.   err10044 * = errcMsg+44;        (*  invalid expression result   *)
  396.   err10045 * = errcMsg+45;        (*  expression required         *)
  397.   err10046 * = errcMsg+46;        (*  boolean value not 0 or 1    *)
  398.   err10047 * = errcMsg+47;        (*  arithmetic conversion error *)
  399.   err10048 * = errcMsg+48;        (*  invalid operand             *)
  400.  
  401. (*
  402.  * Return Codes for general use
  403.  *)
  404.   ok     * = 0;                   (*  success                     *)
  405.   warn   * = 5;                   (*  warning only        *)
  406.   error  * = 10;                  (*  something's wrong           *)
  407.   fatal  * = 20;                  (*  complete or severe failure  *)
  408.  
  409.  
  410. (*
  411. **      $VER: rxslib.h 1.6 (8.11.91)
  412. **
  413. **      The header file for the REXX Systems Library
  414. *)
  415.  
  416.  
  417. CONST
  418.  
  419.   rxsName  * = "rexxsyslib.library";
  420.   rxsDir   * = "REXX";
  421.   rxsTName * = "ARexx";
  422.  
  423. (* The REXX systems library structure.  This should be considered as    *)
  424. (* semi-private and read-only, except for documented exceptions.        *)
  425.  
  426. TYPE
  427.  
  428.   RxsLibPtr * = POINTER TO RxsLib;
  429.   RxsLib * = RECORD (e.LibraryBase)
  430.     node *       : e.Library;        (* EXEC library node             *)
  431.     flags *      : s.SET8;           (* global flags                  *)
  432.     shadow *     : s.SET8;           (* shadow flags                  *)
  433.     sysBase *    : e.LibraryPtr;     (* EXEC library base             *)
  434.     dosBase *    : d.DosLibraryPtr;  (* DOS library base              *)
  435.     ieeeDPBase * : e.LibraryPtr;     (* IEEE DP math library base     *)
  436.     segList *    : e.BPTR;           (* library seglist               *)
  437.     nil *        : d.FileHandlePtr;  (* global NIL: filehandle        *)
  438.     chunk *      : LONGINT;          (* allocation quantum            *)
  439.     maxNest *    : LONGINT;          (* maximum expression nesting    *)
  440.     null *       : NexxStrPtr;       (* static string: NULL           *)
  441.     false *      : NexxStrPtr;       (* static string: FALSE          *)
  442.     true *       : NexxStrPtr;       (* static string: TRUE           *)
  443.     rexx *       : NexxStrPtr;       (* static string: REXX           *)
  444.     command *    : NexxStrPtr;       (* static string: COMMAND        *)
  445.     stdin *      : NexxStrPtr;       (* static string: STDIN          *)
  446.     stdout *     : NexxStrPtr;       (* static string: STDOUT         *)
  447.     stderr *     : NexxStrPtr;       (* static string: STDERR         *)
  448.     version *    : e.LSTRPTR;        (* version string                *)
  449.  
  450.     taskName *   : e.LSTRPTR;        (* name string for tasks *)
  451.     taskPri *    : LONGINT;          (* starting priority             *)
  452.     taskSeg *    : e.BPTR;           (* startup seglist               *)
  453.     stackSize *  : LONGINT;          (* stack size                    *)
  454.     rexxDir *    : e.LSTRPTR;        (* REXX directory                *)
  455.     cTABLE *     : e.LSTRPTR;        (* character attribute table     *)
  456.     notice *     : e.LSTRPTR;        (* copyright notice              *)
  457.  
  458.     rexxPort *   : e.MsgPort;        (* REXX public port              *)
  459.     readLock *   : e.UWORD;          (* lock count                    *)
  460.     traceFH *    : d.FileHandlePtr;  (* global trace console          *)
  461.     taskList *   : e.List;           (* REXX task list                *)
  462.     numTask *    : INTEGER;          (* task count                    *)
  463.     libList *    : e.List;           (* Library List header           *)
  464.     numLib *     : INTEGER;          (* library count                 *)
  465.     clipList *   : e.List;           (* ClipList header               *)
  466.     numClip *    : INTEGER;          (* clip node count               *)
  467.     msgList *    : e.List;           (* pending messages              *)
  468.     numMsg *     : INTEGER;          (* pending count                 *)
  469.     pgmList *    : e.List;           (* cached programs               *)
  470.     numPgm *     : INTEGER;          (* program count                 *)
  471.  
  472.     traceCnt *   : e.UWORD;          (* usage count for trace console *)
  473.     avail *      : INTEGER;
  474.   END; (* RxsLib *)
  475.  
  476. CONST
  477.  
  478. (* Global flag bit definitions for RexxMaster                           *)
  479.   (* trace * = trace;        (* interactive tracing?          *) *)
  480.   (* halt  * = halt;         (* halt execution?               *) *)
  481.   (* susp  * = susp;         (* suspend execution?            *) *)
  482.   stop  * = 6;               (* deny further invocations      *)
  483.   (* close * = 7;               (* close the master              *) *)
  484.  
  485.   rlfMask    * = { trace, halt, susp };
  486.  
  487. (* Initialization constants                                             *)
  488.   rxsChunk   * = 1024;        (* allocation quantum            *)
  489.   rxsNest    * = 32;          (* expression nesting limit      *)
  490.   rxsTPri    * = 0;           (* task priority         *)
  491.   rxsStack   * = 4096;        (* stack size                    *)
  492.  
  493. (* Character attribute flag bits used in REXX.                          *)
  494.   ctSpace   * = 0;                  (* white space characters        *)
  495.   ctDigit   * = 1;                  (* decimal digits 0-9            *)
  496.   ctAlpha   * = 2;                  (* alphabetic characters *)
  497.   ctRexxSym * = 3;                  (* REXX symbol characters        *)
  498.   ctRexxOpr * = 4;                  (* REXX operator characters      *)
  499.   ctRexxSpc * = 5;                  (* REXX special symbols          *)
  500.   ctUpper   * = 6;                  (* UPPERCASE alphabetic          *)
  501.   ctLower   * = 7;                  (* lowercase alphabetic          *)
  502.  
  503.  
  504. PROCEDURE [0] ActionCode * (action : LONGINT): LONGINT;
  505. (*
  506.  * Filter Command code out of RexxMsg.action. Result will be one of rxComm,
  507.  * rxFunc,...
  508.  *)
  509. BEGIN
  510.   RETURN SYS.VAL(LONGINT,SYS.VAL(SET,action) * SYS.VAL(SET,rxCodeMask));
  511. END ActionCode;
  512.  
  513.  
  514. PROCEDURE [0] ActionFlags * (action : LONGINT): s.SET32;
  515. (*
  516.  * Filter Command modifier flag bit out of RexxMsg.action. Result will be a set of
  517.  * rxfNoIO, rxfResult, ...
  518.  *)
  519. BEGIN
  520.   RETURN SYS.VAL(SET,action) * {16..23}
  521. END ActionFlags;
  522.  
  523. PROCEDURE [0] ActionArg * (action : LONGINT): LONGINT;
  524. (*
  525.  * Filter Arg out of RexxMsg.action.
  526.  *)
  527. BEGIN
  528.   RETURN action MOD 16;
  529. END ActionArg;
  530.  
  531. PROCEDURE [0] IVALUE * (nsPtr : NexxStrPtr): LONGINT;
  532. BEGIN
  533.   RETURN nsPtr.ivalue
  534. END IVALUE;
  535.  
  536. (* Field definitions                                                    *)
  537.  
  538. PROCEDURE [0] ARG0 * (rmp : RexxMsgPtr): e.APTR; (* start of argblock             *)
  539. BEGIN
  540.   RETURN rmp.args[0]
  541. END ARG0;
  542.  
  543. PROCEDURE [0] ARG1 * (rmp : RexxMsgPtr): e.APTR; (* first argument                *)
  544. BEGIN
  545.   RETURN rmp.args[1]
  546. END ARG1;
  547.  
  548. PROCEDURE [0] ARG2 * (rmp : RexxMsgPtr): e.APTR; (* second argument               *)
  549. BEGIN
  550.   RETURN rmp.args[2]
  551. END ARG2;
  552.  
  553.  
  554. (* The Library List contains just plain resource nodes.         *)
  555.  
  556. PROCEDURE [0] LLOFFSET * (rrp : RexxRsrcPtr): LONGINT;  (* "Query" offset     *)
  557. BEGIN
  558.   RETURN SYS.VAL(LONGINT,rrp.arg1)
  559. END LLOFFSET;
  560.  
  561. PROCEDURE [0] LLVERS * (rrp: RexxRsrcPtr): LONGINT;    (* library version    *)
  562. BEGIN
  563.   RETURN SYS.VAL(LONGINT,rrp.arg2)
  564. END LLVERS;
  565.  
  566. (*
  567.  * The RexxClipNode structure is used to maintain the Clip List.  The value
  568.  * string is stored as an argstring in the rr_Arg1 field.
  569.  *)
  570. PROCEDURE [0] CLVALUE * (rrp : RexxRsrcPtr): e.LSTRPTR;
  571. BEGIN
  572.   RETURN rrp.arg1
  573. END CLVALUE;
  574.  
  575.  
  576. END Rexx.
  577.